<style type='text/css'>
	.addAccount_form{
		border: 2px solid #46A3FF;
		padding: 15px;
		margin-left: 15px;
		margin-right: 15px;
		margin-top: 5px;
		margin-bottom: 5px;
		color:red;
	}	
	.lable1{color: #6D6D6D;
	        font-size: 20px;
	        font-weight: bold;
	  } 
	 .lable2{color: #6D6D6D;
	        font-size: 15px;
	        font-weight: bold;
	  }  
	 .input{  
	        width:308px;
	        border: 1px 
	        solid #46A3FF;
	        height: 30px;  
	        maxlength:225 
	        class:required
	  }
	 
</style>

    


<!--显示-->	
<form id='addAccount_form' method="post">
<fieldset class='addAccount_form'>
	<legend style='padding: 5px 10px 0'>
	<div class="lable1">
		<label>查询区</lable>
	</div>
	</legend><br>
	<table align="center"><tr>
	<td><div class="lable1">
	<label for="input" class="required">请输入需充值的额度帐号：</label>
	</div></td><td><div class="input">
	<input type="text" id="input" name="input"   value="" >	</div></td><td>	
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<input id="okbtn" type="button" value="查询" style="border: 1px solid #3580A9;text-shadow: 0px -1px 0px #2C6AA3;font-weight: bold;font-size:20px;padding: 5px 10px;border-radius: 3px 3px 3px 3px;box-shadow: 0px 1px 5px #B2B2B2;">
	</td></tr></table><br><br>

</fieldset>
</form>


<!--查询后显示-->
<div style="display:none " id="recharge">
<form id='addAccount_form' method="post">
<fieldset class='addAccount_form'>
	<legend style='padding: 5px 10px 0'>
	<div class="lable1">
		<label>额度账户基本信息</lable></div>
	</legend>	<br><br>
	<table align="center"><tr><td>
	<div class="lable2">
	<label id="lable1" for="input1" class="required" >额度帐号：</label></div></td><td><div class="input">
	<input type="text" id="input1" name="input1"  value="" readonly="true">
	</div></td><td><div class="lable2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<label id="lable2" for="input2" class="required" >真实姓名：</label></div></td><td><div class="input">
	<input type="text" id="input2" name="input2"  value="" readonly="true">
	</div></td></tr><tr><td><br></td><tr><td><br></td></tr><tr><td><div class="lable2">
	<label id="lable3" for="input3" class="required" >身份证号：</label></div></td><td><div class="input">
	<input type="text" id="input3" name="input3"  value="" readonly="true">
	</div></td><td><div class="lable2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<label id="lable4" for="input4" class="required" >账户余额：</label></div></td><td><div class="input">
	<input type="text" id="input4" name="input4"  value="" readonly="true">
	</div></td></tr><tr><td><br></td><tr><td><br></td></tr><tr><td><div class="lable2">
	<label id="lable5" for="input5" class="required" >提成点数：</label></div></td><td><div class="input">
	<input type="text" id="input5" name="input5"  value="" readonly="true">
	</div></td><td><div class="lable2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<label id="lable6" for="input6" class="required" >账户类型：</label></div></td><td><div class="input">
	<input type="text" id="input6" name="input6"  value="" readonly="true">
	</div></td></tr></table><br><br><br><br>	
</fieldset>
</form>

<form id='addAccount_form' method="post">
<fieldset class='addAccount_form'>
	<legend style='padding: 5px 10px 0'>
	<div class="lable1">
		<label>充值区</lable></div>
	</legend><br>
	<table align="center"><tr>
	<td><div class="lable1">	
     <label id="lable7" for="input7" class="required">请输入需充值的金额：</label></div></td><td><div class="input">
	<input type="text" id="input7" name="input7"  value="">		</div></td><td>		
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<input id="okbtn1" type="button" value="确定充值" style="border: 1px solid #3580A9;text-shadow: 0px -1px 0px #2C6AA3;font-weight: bold;font-size:20px;padding: 5px 10px;border-radius: 3px 3px 3px 3px;box-shadow: 0px 1px 5px #B2B2B2;"> <br><br>	
	</td></tr></table><br><br>
	</fieldset>
</form>
</div>

<center>
<div id="acc_info" style="color: #6D6D6D;font-size: 20px;font-weight: bold;">
</div>
</center>










<script type="text/javascript">

$("#okbtn").click(function(){        
		$.ajax({
				type:'POST',
				dataType:"json",
				url:'/lottery/account/search',
				data:{account:$("#input").val()},
	          	success:function(data){
	          	    var obj=document.getElementById("input1");
                    obj.value=data.accounts[0].account; 
                    var obj=document.getElementById("input2");
                    obj.value=data.accounts[0].name; 
                    var obj=document.getElementById("input3");
                    obj.value=data.accounts[0].identify;
                    var obj=document.getElementById("input4");
                    obj.value=data.accounts[0].balance;
                    var obj=document.getElementById("input5");
                    obj.value=data.accounts[0].commissionRatio;
                    var obj=document.getElementById("input6");
                    obj.value=data.accounts[0].accountType;
                    
	          	    var obj=document.getElementById("recharge");
                    obj.style.display=""; 
	          	    //cc = "<div>额度账户："+data.accounts[0].account+"</div>"
	          	    //cc = cc+"<div>真实姓名："+data.accounts[0].name+"</div>"
	          	    //cc = cc+"<div>身份证号："+data.accounts[0].identify+"</div>"
	          	    //cc = cc+"<div>账户余额："+data.accounts[0].balance+"</div>"
	          	    //cc = cc+"<div>提成点数："+data.accounts[0].commissionRatio+"</div>"
	          	    //cc = cc+"<div>账户类型："+data.accounts[0].accountType+"</div>"
	          		//$("#acc_info").html(cc)	          		                		               	    
			    },
				error: function(){
					$.jBox.error('账户不存在，请重新输入');
					//add('/lottery/account/recharge','出错')
					//window.location.href = '/lottery/account/recharge'
				}
			})
			});
			
			
$("#okbtn1").click(function(){
		$.ajax({
				type:'POST',
				dataType:"json",
				url:'/lottery/account/surerechage',
				data:{money:$("#input7").val(),account:$("#input").val()},
	          	success:function(data){
	          	    var obj=document.getElementById("input");
                    obj.value=""; 
	          	    var obj=document.getElementById("input1");
                    obj.value=""; 
                    var obj=document.getElementById("input2");
                    obj.value=""; 
                    var obj=document.getElementById("input3");
                    obj.value="";
                    var obj=document.getElementById("input4");
                    obj.value="";
                    var obj=document.getElementById("input5");
                    obj.value="";
                    var obj=document.getElementById("input6");
                    obj.value="";
                    
	          	    var obj=document.getElementById("recharge");
                    obj.style.display="none"; 
	          	    
	          	    $.jBox.tip('您已成功充值!');
	          	    //cc="<div>您已成功充值："+data.money+"</div>"
	          	    //cc=cc+"<div>账户余额："+data.accounts[0].balance+"</div>"
	          		//$("#acc_info").html(cc)
	          		add('/lottery/account/list1','余额信息');
	          		$("#accounts_grid").datagrid('reload');
			    },
				error: function(){
					$.jBox.error('充值失败');
					//add('/lottery/account/recharge','出错')
					//window.location.href = '/lottery/account/recharge'
				}
			})
			});
</script>

